﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;

class EventManager
{
    ContentManager content;

    public EventManager(ContentManager content)
    {
        //Console.WriteLine("event manager criado");
        this.content = content;
    }

    public void CheckEvents(int[,] objectsMatriz, int[,] eventsMatriz)
    {
        //Console.WriteLine("passei por aki");

        for (int k = 0; k < 40; k++)
        {
            //Console.WriteLine("checando evento");

            if (eventsMatriz[0, k] >= 0)
            {
                //Console.WriteLine("     checando evento" + objectsMatriz[eventsMatriz[1, k], eventsMatriz[2, k]]);

                if (objectsMatriz[eventsMatriz[1, k], eventsMatriz[2, k]] == (int)ObjectKind.Enemy)
                {

                    switch (eventsMatriz[0, k])
                    {
                        case 1:
                            Bandido bandido = new Bandido(0.2f, 0.7f, new Vector2(eventsMatriz[1, k] * 64, eventsMatriz[2, k] * 64));
                            GameSession.CharactersList.Add(bandido);
                            break;
                        case 2:
                            Arqueiro arqueiro = new Arqueiro(0.2f, 0.7f, new Vector2(eventsMatriz[1, k] * 64, eventsMatriz[2, k] * 64));
                            GameSession.CharactersList.Add(arqueiro);
                            break;
                        case 3:
                            Keity keity = new Keity(0.2f, 0.7f, new Vector2(eventsMatriz[1, k] * 64, eventsMatriz[2, k] * 64));
                            GameSession.CharactersList.Add(keity);
                            break;
                        case 4:
                            MagoNegro magoNegro = new MagoNegro(0.2f, 0.7f, new Vector2(eventsMatriz[1, k] * 64, eventsMatriz[2, k] * 64));
                            GameSession.CharactersList.Add(magoNegro);
                            break;
                        case 5:
                            Murtandela murtandela = new Murtandela(0.2f, 0.7f, new Vector2(eventsMatriz[1, k] * 64, eventsMatriz[2, k] * 64));
                            GameSession.CharactersList.Add(murtandela);
                            break;
                        case 6:
                            Roska roska = new Roska(0.2f, 0.7f, new Vector2(eventsMatriz[1, k] * 64, eventsMatriz[2, k] * 64));
                            GameSession.CharactersList.Add(roska);
                            break;
                        case 7:
                            Sal sal = new Sal(0.2f, 0.7f, new Vector2(eventsMatriz[1, k] * 64, eventsMatriz[2, k] * 64));
                            GameSession.CharactersList.Add(sal);
                            break;
                    }

                }
                else
                {
                    if (objectsMatriz[eventsMatriz[1, k], eventsMatriz[2, k]] == (int)ObjectKind.Barrel)
                    {
                        Objects obj = new Objects(ObjectKind.Barrel, eventsMatriz[1, k], eventsMatriz[2, k]);
                    }
                }
            }
        }

    }
}